<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (Schema::hasTable('teacher')) { return; }

        Schema::create('teacher', function (Blueprint $table) {
            $table->id()->unique();
$table->string('name', 50)->comment('姓名');
$table->string('phone', 50)->comment('手机号');
$table->string('password', 255)->comment('密码');
$table->string('sc_ids', 255)->comment('负责学科配置id');
$table->string('login_ip', 100)->comment('登录IP');
$table->integer('login_at')->comment('登录时间');
$table->tinyInteger('status')->default(1)->comment('状态，1：正常，2：删除');
$table->creatorId();
$table->createdAt();
$table->updatedAt();

$table->engine='InnoDB';
$table->comment('教师表');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('teacher');
    }
};
